"use strict";
// 实现上面两个签名
function showResult(n) {
    if (typeof n == 'number') {
        console.log("数值 = ", n);
        return n;
    }
    console.log("字符串 = ", n);
}
showResult(1);
showResult("1");
function getSum(n) {
    let result = 0;
    if (typeof n == 'number') {
        for (let i = 1; i <= n; i++) {
            result += i;
        }
        return result;
    }
    else if (typeof n == 'string') {
        return getSum(parseInt(n));
    }
    else {
        console.error("数据类型不规范");
        return 0;
    }
}
let result = getSum(10);
console.log(result);
result = getSum('100');
console.log(result);
